]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Fix closure annotations
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 6 Nov 2024 13:46:31 +0000 (14:46 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 23 Nov 2024 12:16:49 +0000 (13:16 +0100)
Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/:

    Whenever you’re describing a function that takes a callback, you
    should always annotate the callback argument with the argument that
    contains the user data using the (closure argument) annotation

    You should not annotate the data argument with a unary (closure).

    The unary (closure) is meant to be used when annotating the callback
    type

Recently gobject-introspection became a bit more strict with this and
that generated some warnings:

    Warning: St: invalid "closure" annotation: only valid on callback
    parameters

This commit fix all the closure annotations.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3535>
(cherry picked from commit 411fe9c42f1e4617ddbdd5207998b67abe036806)

src/st/st-icon-theme.c

index 7223c33abb8742f6e0db3fde01458b5a96c5d219..4563c0df09ad281e4cf718aaf6516911c6e48c4d 100644 (file)
@@ -3494,9 +3494,9 @@ load_icon_thread  (GTask        *task,
  * st_icon_info_load_icon_async:
  * @icon_info: a #StIconInfo
  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
- * @callback: (scope async): a #GAsyncReadyCallback to call when the
+ * @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call when the
  *     request is satisfied
- * @user_data: (closure): the data to pass to callback function
+ * @user_data: the data to pass to callback function
  *
  * Asynchronously load, render and scale an icon previously looked up
  * from the icon theme using [method@St.IconTheme.lookup_icon].
@@ -4039,9 +4039,9 @@ load_symbolic_icon_thread (GTask        *task,
  *     success colors of the icon
  * @cancellable: (allow-none): optional #GCancellable object,
  *     %NULL to ignore
- * @callback: (scope async): a #GAsyncReadyCallback to call when the
+ * @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call when the
  *     request is satisfied
- * @user_data: (closure): the data to pass to callback function
+ * @user_data: the data to pass to callback function
  *
  * Asynchronously load, render and scale a symbolic icon previously looked up
  * from the icon theme using [method@St.IconTheme.lookup_icon].